package com.rd.p2p.app.recharge;

import java.util.HashMap;
import java.util.Map;

import javax.annotation.Resource;

import org.apache.struts2.convention.annotation.Action;

import com.opensymphony.xwork2.ModelDriven;
import com.qdlc.p2p.biz.service.AccountRechargeService;
import com.qdlc.p2p.biz.web.action.BaseAction;
import com.qdlc.p2p.common.util.StringUtil;
import com.qdlc.p2p.dal.common.model.jpa.PageDataList;
import com.qdlc.p2p.dal.dto.User;
import com.qdlc.p2p.dal.model.AccountRechargeModel;

public class AppRechargeAction extends BaseAction<AccountRechargeModel> implements ModelDriven<AccountRechargeModel> {

	@Resource
	private AccountRechargeService accountRechargeService;

	private Map<String, Object> data;

	/**
	 * App充值记录接口
	 * 
	 * @return
	 */
	@Action("/app/user/LogList")
	public void logList() throws Exception {
		User user = getSessionUser();
		long userId = user.getUserId();
		String status = paramString("status");
		if (StringUtil.isBlank(status)) {
			model.setStatus(99);
		}
		PageDataList<AccountRechargeModel> pageDataList = accountRechargeService.list(userId, model);
		data = new HashMap<String, Object>();
		data.put("data", pageDataList);
		data.put("resCode", "1");
		printWebJson(getStringOfJpaObj(data));
	}
}
